Skip to content

HRW/HRW4U: Adds SERVER-HEADER & SERVER-URL#12840

Open
zwoop wants to merge 2 commits intoapache:masterfrom
zwoop:HRWServerConds
Open

HRW/HRW4U: Adds SERVER-HEADER & SERVER-URL#12840
zwoop wants to merge 2 commits intoapache:masterfrom
zwoop:HRWServerConds

Conversation

@zwoop
Copy link
Contributor

@zwoop zwoop commented Jan 29, 2026

No description provided.

@zwoop zwoop added this to the 10.2.0 milestone Jan 29, 2026
@zwoop zwoop requested a review from mlibbey January 29, 2026 15:54
@zwoop zwoop self-assigned this Jan 29, 2026
@zwoop zwoop added header_rewrite header_rewrite plugin hrw4u labels Jan 29, 2026
@bryancall bryancall requested a review from bneradt February 2, 2026 22:55
@zwoop
Copy link
Contributor Author

zwoop commented Feb 25, 2026

[approve ci ubuntu]

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds server-origin context primitives to the header_rewrite plugin and synchronizes the HRW4U transpiler + tests so rules can explicitly reference the server request headers and server request URL (as distinct from next-hop destination info).

Changes:

  • header_rewrite: introduce SERVER-HEADER and SERVER-URL conditions and resource gathering for server request headers.
  • hrw4u: remap outbound.req.*SERVER-HEADER and outbound.url.*SERVER-URL, add nexthop.* mapping, and adjust reverse resolution behavior.
  • Tests/docs: update HRW4U fixtures, LSP expectations, add a gold test + rule file, and document the new condition tags.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/hrw4u/tests/test_lsp.py Updates LSP completion expectations for outbound URL availability (SERVER-URL timing).
tools/hrw4u/tests/data/hooks/send_request.output.txt Updates expected output to use SERVER-HEADER instead of context-sensitive HEADER.
tools/hrw4u/tests/data/examples/all-nonsense.output.txt Regenerates example output to reflect SERVER-URL and SERVER-HEADER mappings.
tools/hrw4u/tests/data/examples/all-nonsense.input.txt Updates example comments to reflect server URL semantics.
tools/hrw4u/tests/data/examples/all-nonsense.ast.txt Regenerates AST snapshot to match updated HRW4U semantics.
tools/hrw4u/tests/data/conds/query-param.output.txt Updates query-param condition output to use SERVER-URL:QUERY.
tools/hrw4u/tests/data/conds/outbound.output.txt Updates outbound URL fixtures to use SERVER-URL.
tools/hrw4u/tests/data/conds/nexthop.input.txt Adds HRW4U input covering nexthop.* usage.
tools/hrw4u/tests/data/conds/nexthop.output.txt Adds expected header_rewrite output for next-hop + server-header usage.
tools/hrw4u/tests/data/conds/nexthop.ast.txt Adds AST snapshot for the new nexthop fixture.
tools/hrw4u/src/types.py Adds a suffix group for nexthop fields.
tools/hrw4u/src/tables.py Updates symbol mappings for SERVER-HEADER, SERVER-URL, and nexthop.* plus reverse-resolution tables.
tools/hrw4u/src/hrw_symbols.py Adjusts reverse prefix condition rewriting to normalize multi-part payloads.
tools/hrw4u/pyproject.toml Bumps HRW4U version.
tests/gold_tests/pluginTest/header_rewrite/rules/rule_server_conditions.conf New gold-test rule validating SERVER-HEADER and SERVER-URL.
tests/gold_tests/pluginTest/header_rewrite/header_rewrite_bundle.replay.yaml Adds a new replay session to validate SERVER-* conditions.
plugins/header_rewrite/resources.h Extends Resources with server request header handles.
plugins/header_rewrite/resources.cc Gathers/releases server request header resources.
plugins/header_rewrite/factory.cc Registers SERVER-HEADER and SERVER-URL condition names.
plugins/header_rewrite/conditions.h Extends condition type enums to support server variants.
plugins/header_rewrite/conditions.cc Implements server variants for header and URL evaluation.
doc/admin-guide/plugins/header_rewrite.en.rst Documents SERVER-HEADER and SERVER-URL in header_rewrite docs.
doc/admin-guide/configuration/hrw4u.en.rst Updates HRW4U mapping docs for new server-aware symbols.

@zwoop
Copy link
Contributor Author

zwoop commented Feb 25, 2026

I've address CoPilot's review suggestions.

@zwoop
Copy link
Contributor Author

zwoop commented Feb 26, 2026

[approve ci autest 0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

header_rewrite header_rewrite plugin hrw4u

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants